#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_add_clicked()
{
    double d=windowOpacity();
    qDebug()<<d;
    //判断一下当前的不透明度有没有超过最大值1
    if(d>=1)
    {
        return;
    }
    this->setWindowOpacity(d+0.1);

}

void Widget::on_pushButton_sub_clicked()
{
    double d=windowOpacity();
    qDebug()<<d;
    if(d<=0)
    {
        return;
    }
    this->setWindowOpacity(d-0.1);

}
